package com.xbongbong.paas.toolbox.util;

import okhttp3.Call;
import okhttp3.Response;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

/**
 * 默认OkHttpUtil.NetCall实现，只进行了输出
 * @author kaka
 * @date 2022-8-9
 */
public class DefaultNetCall implements OkHttpUtil.NetCall {

    private static final Logger LOG = LoggerFactory.getLogger(DefaultNetCall.class);

    @Override
    public void success(Call call, Response response) throws IOException {
        LOG.debug("DefaultNetCall success:" + response.message());
    }

    @Override
    public void failed(Call call, IOException e) {
        LOG.warn("DefaultNetCall failed:", e);
    }
}
